package figury;

import java.util.Scanner;

public class Trojkat implements Pole {

    private double r;
    private double pole;

    @Override
    public void pole() {
        int b;
        System.out.println("Podaj promień koła:");
        Scanner promien = new Scanner(System.in);
        r = promien.nextDouble();
        pole = r * r * Math.PI;
        b = (int) r;
        if (r % b == 0) {
            System.out.printf("Koło o promieniu " + b + " ma pole o wartości P=%.2f", pole);
            System.out.println();
        } else {
            System.out.printf("Koło o promieniu " + r + " ma pole o wartości P=%.2f", pole);
            System.out.println();
        }
    }

}
